<template>
	<view class="container">
		<view class="top">
			<view class="search-box">
				<headerSearch bgColor="#F6F6F6" placeholder="搜索"></headerSearch>
			</view>
			<view class="order-tab">
				<view class="tab-item" :class="[item.value==tab_index?'select':'']" v-for="(item,i) in tabList" :key="i" @click="tab_index=item.value">
					<text>{{item.text}}</text>
					
					<view v-if="i==2" class="show-num">5</view>
				</view>
			</view>
		</view>
		<view class="list">
			<view class="item" v-for="(item,i) in 6" :key="i">
				<view class="box-1" @click="toDetail()">
					<view class="left">
						<image :src="$img_path('/mall/5.png')" mode="aspectFill"></image>
						<view class="info">
							<view class="name">
								李四
							</view>
							<view class="text">
								54岁 | 河南省 | 初中
							</view>
							<view class="text more-row" style="--row-num:2">
								介绍内容介绍内容介绍内容介绍内容
								介绍内容介绍内容介绍介绍内容介介绍内容介
							</view>
						</view>
					</view>
					<view class="right">
					</view>
				</view>
				
				<view v-if="tab_index==1" class="btn-box s-1">
					<view @click.stop="toEdit">编辑</view>
					<view @click.stop="$refs.confrimBox.open()">上架</view>
				</view>
				<view v-if="tab_index==0" class="btn-box">
					<view @click.stop="$refs.confrimBox.open()">下架</view>
				</view>
				<view v-if="tab_index==2" class="btn-box s-1">
					<view @click.stop="$refs.returnBox.open()">驳回</view>
					<view @click.stop="$refs.TGBox.open()">通过</view>
				</view>
				<view v-if="tab_index==3" class="btn-box">
					<view @click.stop="$refs.confrimBox.open()">查看</view>
				</view>
			</view>
		</view>
		
		
		<popupBox ref="confrimBox" contentBG="#ffffff">
			<view class="popup-con">
				<view class="title">
					提示
				</view>
				<view class="c-text">
					确定下架吗？
				</view>
			</view>
		</popupBox>
		
		<popupBox ref="returnBox" contentBG="#ffffff">
			<view class="popup-con">
				<view class="title">
					驳回
				</view>
				<view class="c-textarea">
					<textarea placeholder="请输入驳回原因" placeholder-class="pla-class"></textarea>
				</view>
			</view>
		</popupBox>
		
		<popupBox ref="TGBox" contentBG="#ffffff" cancelText="暂不上架" confirmText="立即上架">
			<view class="popup-con">
				<view class="title" style="padding-bottom: 80rpx;">
					通过
				</view>
			</view>
		</popupBox>
	</view>
</template>

<script>
	import { areaBmList } from '@/utils/api/serviceApi.js'
	import popupBox from '@/components/popup/popup.vue'
	import headerSearch from '@/components/header-search/header-search.vue'
	export default {
		components:{
			headerSearch,
			popupBox
		},
		data() {
			return {
				tabList:[
					{
						text:'已上架',
						value:3
					},{
						text:'待上架',
						value:2
					},{
						text:'待审核',
						value:0
					},{
						text:'被驳回',
						value:1
					}
				],
				tab_index:0,
				
			};
		},
		onLoad() {
			this.getList()
		},
		methods:{
			getList(){
				areaBmList({
					status:this.tab_index
				}).then(res=>{
					
				})
			},
			
			change(){},
			bindChange(val){
				console.log(val,'-')
			},
			close(){
				this.$refs.popup.close()
			},
			confirm(){
				this.close()
				
			},
			
			toDetail(){
				uni.navigateTo({
					url:`/pagesRegion/nurseReview/detail`
				})
			},
			
			toEdit(){
				uni.navigateTo({
					url:'/pagesRegion/nurseReview/edit'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.container{
	.top{
		position: sticky;
		top: 0;
		left: 0;
		right: 0;
		z-index: 3;
		background-color: #FFFFFF;
		.search-box{
			padding: 14rpx 22rpx 0;
			header-search{
				height: 84rpx;
			}
		}
		.order-tab{
			padding: 24rpx 22rpx 12rpx; 
			box-sizing: border-box;
			display: flex;
			align-items: center;
			justify-content: space-between;
			background-color: #FFFFFF;
			.tab-item{
				position: relative;
				.show-num{
					position: absolute;
					top: 0;
					right: 0;
					transform: translateX(80%) translateY(-30%);
					display: block;
					width: 32rpx;
					height: 32rpx;
					background: #FF4A4A;
					border-radius: 50%;
					font-weight: 400;
					font-size: 20rpx;
					color: #FFFFFF;
					line-height: 32rpx;
					text-align: center;
				}
				text{
					font-weight: 400;
					font-size: 32rpx;
					color: #333333;
					line-height: 44rpx;
					position: relative;
				}
				&.select{
					text{
						font-weight: bold;
						font-size: 32rpx;
						color: #E72A2A;
						line-height: 44rpx;
						&::after{
							content: '';
							width: 52rpx;
							height: 8rpx;
							background: #E72A2A;
							border-radius: 4rpx;
							position: absolute;
							top: calc(100% + 4rpx);
							left: 50%;
							transform: translateX(-50%);
						}
					}
				}
			}
		}
	}
	
	.list{
		padding: 0 22rpx;
		box-sizing: border-box;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
		.item{
			padding: 28rpx 28rpx 38rpx;
			box-sizing: border-box;
			background: #FFFFFF;
			border-radius: 20rpx;
			margin-top: 20rpx;
			.box-1{
				display: flex;
				align-items: flex-start;
				justify-content: space-between;
				.left{
					display: flex;
					// align-items: center;
					image{
						width: 192rpx;
						height: 192rpx;
						border-radius: 20rpx;
					}
					.info{
						width: calc(100% - 192rpx);
						padding-left: 20rpx;
						box-sizing: border-box;
						text-align: left;
						.name{
							font-weight: bold;
							font-size: 36rpx;
							color: #000000;
							line-height: 50rpx;
						}
						.text{
							font-weight: 400;
							font-size: 28rpx;
							color: #333333;
							line-height: 40rpx;
							margin-top: 10rpx;
						}
					}
				}
			}
			.btn-box{
				display: flex;
				justify-content: flex-end;
				padding-top: 26rpx;
				&>view{
					width: 152rpx;
					height: 66rpx;
					background: linear-gradient( 90deg, #FFA233 0%, #FB4C4C 100%);
					border-radius: 34rpx;
					font-weight: 400;
					font-size: 28rpx;
					color: #FFFFFF;
					line-height: 66rpx;
					margin-left: 20rpx;
				}
				
				&.s-1{
					view:nth-child(1){
						background: #FFFFFF;
						border-radius: 34rpx 34rpx 34rpx 34rpx;
						border: 2rpx solid #FF4A4A;
						color: #FF4A4A;
					}
				}
			}
		}
	}
}


.popup-con{
	.title{
		text-align: center;
		font-weight: bold;
		font-size: 36rpx;
		color: #000000;
		line-height: 50rpx;
		padding: 28rpx 0 0rpx;
	}
	.c-text{
		font-weight: bold;
		font-size: 36rpx;
		color: #000000;
		line-height: 50rpx;
		padding-bottom: 66rpx;
		margin-top: 70rpx;
	}
	
	
	.c-textarea{
		width: 508rpx;
		height: 198rpx;
		background: #FFFFFF;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		border: 2rpx solid #B4B4B4;
		margin-top: 18rpx;
		margin-bottom: 42rpx;
		textarea{
			width: 100%;
			height: 100%;
			padding: 22rpx 20rpx;
			box-sizing: border-box;
			/deep/ .pla-class{
				font-weight: 400;
				font-size: 32rpx;
				color: #B4B4B4;
				line-height: 44rpx;
			}
		}
	}
}

	.p-top{
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		padding: 36rpx 28rpx 10rpx;
		box-sizing: border-box;
		.left{
			font-weight: bold;
			font-size: 30rpx;
			color: #333333;
			line-height: 42rpx;
		}
		.title{
			font-weight: bold;
			font-size: 36rpx;
			color: #333333;
			line-height: 50rpx;
		}
		.right{
			font-weight: bold;
			font-size: 30rpx;
			color: #E72A2A;
			line-height: 42rpx;
		}
	}
	
	.popup-content{
		padding: 0 22rpx;
		box-sizing: border-box;
		
	}
	
	.picker-view {
		width: 100%;
		height: 510rpx;
		margin-top: 20rpx;
		position: relative;
		.center-bg{
			width: 100%;
			height: 102rpx;
			background-color: #F4F4F4;
			position: absolute;
			left: 0;
			top: 50%;
			transform: translateY(-50%);
			z-index: 0;
			border-radius: 16rpx;
		}
	}
	/deep/ .item {
		line-height: 102rpx;
		text-align: center;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 36rpx;
		color: #333333;
		font-style: normal;
		text-transform: none;
	}
	.button-b{
		display: flex;
		justify-content: space-between;
		button{
			width: 300rpx;
			height: 82rpx;
			border-radius: 41rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 30rpx;
			line-height: 82rpx;
			text-align: center;
			font-style: normal;
			text-transform: none;
			&:first-child{
				background-color: #F5F5F5;
				color: #777777;
			}
			&:last-child{
				background-color: #FD5100;
				color: #FFFFFF;
				margin-left: 24rpx;
			}
		}
	}
</style>
